﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sto1a00
    {
        private int? _stocode;
		private string _stoname;
		private string _tuser;
		private string _tel;
		private string _fax;
        private int? _statuscode;
		private string _usercode;
		private string _listid;
		private string _stodesc;
		private string _tmp1;
		private string _tmp2;
		private string _tmp3;
		private string _tmp4;
		private string _tmp5;
		
        /// <summary>
        /// 仓库代码
        /// </summary>
		public int? Stocode
		{
			get { return _stocode;	 }
			set { _stocode=value;	}
		}
        /// <summary>
        /// 仓库地址
        /// </summary>
		public string Stoname
		{
			get { return _stoname;	 }
			set { _stoname=value;	}
		}
        /// <summary>
        /// 联系人
        /// </summary>
		public string Tuser
		{
			get { return _tuser;	 }
			set { _tuser=value;	}
		}
        /// <summary>
        /// 联系电话
        /// </summary>
		public string Tel
		{
			get { return _tel;	 }
			set { _tel=value;	}
		}
        /// <summary>
        /// 传真
        /// </summary>
		public string Fax
		{
			get { return _fax;	 }
			set { _fax=value;	}
		}
        /// <summary>
        /// 状态代码
        /// </summary>
		public int? Statuscode
		{
			get { return _statuscode;	 }
			set { _statuscode=value;	}
		}
        /// <summary>
        /// 用户名
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Stodesc
		{
			get { return _stodesc;	 }
			set { _stodesc=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Tmp1
		{
			get { return _tmp1;	 }
			set { _tmp1=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Tmp2
		{
			get { return _tmp2;	 }
			set { _tmp2=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Tmp3
		{
			get { return _tmp3;	 }
			set { _tmp3=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Tmp4
		{
			get { return _tmp4;	 }
			set { _tmp4=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Tmp5
		{
			get { return _tmp5;	 }
			set { _tmp5=value;	}
		}
		
		public static List<Sto1a00> GetSto1a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sto1a00> list = new List<Sto1a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sto1a00 model = GetSto1a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sto1a00 GetSto1a00ByDataRow(DataRow dr)
		{
			Sto1a00 model = new Sto1a00(); //实例化Sto1a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("stocode")&&!(dr["stocode"] is System.DBNull))  
				model.Stocode = ( int)dr["stocode"];
			if (dcc.Contains("stoname")&&!(dr["stoname"] is System.DBNull))  
				model.Stoname = ( string)dr["stoname"];
			if (dcc.Contains("tuser")&&!(dr["tuser"] is System.DBNull))  
				model.Tuser = ( string)dr["tuser"];
			if (dcc.Contains("tel")&&!(dr["tel"] is System.DBNull))  
				model.Tel = ( string)dr["tel"];
			if (dcc.Contains("fax")&&!(dr["fax"] is System.DBNull))  
				model.Fax = ( string)dr["fax"];
			if (dcc.Contains("statuscode")&&!(dr["statuscode"] is System.DBNull))  
				model.Statuscode = ( int)dr["statuscode"];
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("stodesc")&&!(dr["stodesc"] is System.DBNull))  
				model.Stodesc = ( string)dr["stodesc"];
			if (dcc.Contains("tmp1")&&!(dr["tmp1"] is System.DBNull))  
				model.Tmp1 = ( string)dr["tmp1"];
			if (dcc.Contains("tmp2")&&!(dr["tmp2"] is System.DBNull))  
				model.Tmp2 = ( string)dr["tmp2"];
			if (dcc.Contains("tmp3")&&!(dr["tmp3"] is System.DBNull))  
				model.Tmp3 = ( string)dr["tmp3"];
			if (dcc.Contains("tmp4")&&!(dr["tmp4"] is System.DBNull))  
				model.Tmp4 = ( string)dr["tmp4"];
			if (dcc.Contains("tmp5")&&!(dr["tmp5"] is System.DBNull))  
				model.Tmp5 = ( string)dr["tmp5"];
			
			return model;
		}
    }
}
